# -*- coding: utf-8 -*-
# @Time: 2022/4/29 12:53
# @Author: 发抖的小喵喵
# @Email: panyi_20210601@163.com
# @File: 获取商品积分.py
# @Project: haixin
# @Software: PyCharm


from test_case.haixin.Method.Post import post_method


def get_score():
    """
    查询商品的兑换积分
    :return:
    {
    "code": 0,
    "msg": "成功",
    "data": {
        "score": 12.1
        }
    }
    """
    url = "https://api-test.shwoody.com/ma/chiobeansOrder/score"

    data = {
        "shopId": 80101,  # 数据库字段为shop_number
        "skuId": 100020,  # 数据库字段为sku_number
        "price": 0.1,    # 商品成本单价
        "marketPrice": 3,  # 商品市场单价
        "salePrice": 1,    # 商品销售单价
        "saleNum": 1    # 售卖数量。称重商品单位KG,计件为个
    }
    # data = {
    #     "shopId": 80101,  # 数据库字段为shop_number
    #     "skuId": 100010,  # 数据库字段为sku_number
    #     "price": 0.1,  # 商品成本单价
    #     "marketPrice": 2,  # 商品市场单价
    #     "salePrice": 1,  # 商品销售单价
    #     "saleNum": 1  # 售卖数量。称重商品单位KG,计件为个
    # }

    response = post_method(data, url)
    print(response)


if __name__ == "__main__":
    get_score()
